Here's some test sql for all the styles. DECLARE @now datetime SET @now = GETDATE() select convert(nvarchar(MAX), @now, 0) as output, ... ... <看更多>
Search
Search
Here's some test sql for all the styles. DECLARE @now datetime SET @now = GETDATE() select convert(nvarchar(MAX), @now, 0) as output, ... ... <看更多>
On versions prior to 2012 you can do the formatting with the convert function, then cast as int. declare @dateb datetime set @dateb = getdate() select cast( ... ... <看更多>
... <看更多>
SQL convert int to datetime(轉換expression 到資料類型datetime 時發生算術溢位錯誤) ... <看更多>